# Create your views here.
# -*- coding: utf-8 -*-
from django.shortcuts import render_to_response
from django.core.cache import cache

from zlbaobao.app1.config import config

def index(request):
	"""默认主页"""
	#要显示的动态内容：用户登陆信息，商品分类，品牌排行，商品展示，广告
	#加载用户信息
	#加载货架树
	#加载品牌列表
	#加载产品信息
	#加载广告信息
	if cache.get("count"):
		cache.incr("count")
	else:
		cache.set("count",1,12000)
	context = {"user":None,"shelfTree":"货架没有准备好 #" + str(cache.get("count")),"Brands":"brands","Products1":"products1","Products2":"products2","ad":"ad"}
	return render_to_response(config['theme'] + "/index.html", context)

def hello(request):
	"""打个招呼"""
	return render_to_response(config['theme'] + "/hello.html", None)
